package cn.luo.service;

import cn.luo.dao.TagDao;
import cn.luo.entity.Blogs;
import cn.luo.entity.Content;
import cn.luo.entity.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service
public class TagServiceImpl implements TagService {
    @Autowired
    TagDao tagDao;

    //查询全部类型
    @Override
    public List<Tag> findAll() {
        return tagDao.findAll();
    }

    @Override
    public void addTag(Tag tag) {
        Tag tname = tagDao.findByName(tag.getName());
        System.out.println("tname = " + tname);
         if (tname==null){
             tagDao.addType(tag);
         }
    }
}
